package com.example.demo.service;

import com.example.demo.dao.BuildingDao;
import com.example.demo.entity.BuildingEntity;
import com.example.demo.entity.UserEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class BuildingService {
    @Autowired
    private BuildingDao buildingDao;
    /**
     * 通过ID查询单条数据
     */
    public BuildingEntity queryBuildingById(Integer bid){
        return buildingDao.queryBuildingById(bid);
    }

    /**
     * 查询多条数据
     */
    public List<BuildingEntity> queryBuildingAll(){
        return buildingDao.queryBuildingAll();
    }

    /**
     * 新增数据
     * @return
     */
    public int insertBuilding(BuildingEntity building){
        return buildingDao.insertBuilding(building);

    }

    /**
     * 修改数据
     * @return
     */
    public int update(BuildingEntity building){
        return  buildingDao.updateBuilding(building);

    }

    /**
     * 通过主键删除数据
     * @return
     */
    public int deleteById(Integer bid){
        return  buildingDao.deleteBuildingById(bid);

    }
    //重名
    public BuildingEntity checkbulidingService(BuildingEntity building) {
        return buildingDao.checkbulidingDao(building);
    }

}